

var api = require('../../utils/api.js');
var app = getApp();


Page({

    /**
     * 页面的初始数据
     */
    data: {
        value:'',
        lists:[],
        name:''
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {

    },

    getmessage(ret){
        console.log(ret);
        this.setData({
            value:ret.detail.value
        })
    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

        //我的客户
        api.post({
            url: 'client/getmyclient',
            data: {},
            success: data => {
                this.setData({
                    lists:data.data
                })

    
            }
        });
    },
    submits(){
        var that=this;
        var msg=this.data.value;
        var name=this.data.name;

        api.post({
            url: 'feedback/submit',
            data: {msg:msg,name:name},
            success: data => {
                console.log(data)
                wx.showToast({
                  title: data.msg,
                  icon:'none'
                })
                wx.navigateBack();
            }
        });
    },

    bindMultiPickerChange(ret){

        console.log(ret);
        var v=ret.detail.value;

        var list=this.data.lists;

        var name=list[v].name;

        this.setData({
            name:name
        })


    }


})